UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+jj6KkYLzVfrHQ5Zfu8s5OAjIPrOKtfrS103xix9EJQ='
WHERE
key_id = 'f0c20b10e76cc20565765e57fa74481ec8d9fbc8d9db4ecbaa9c297a52fa9b93'
AND (
token = '+jj6KkYLzVfrHQ5Zfu8s5OAjIPrOKtfrS103xix9EJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)