UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ke6Ty8P0/xy0lkO2DuR/F75vkTE40mXeVKgYmdAo9DU='
WHERE
key_id = '2c187743be33cb99b1a502b3b748830dd2e01136843b6d91020fb417ae9035fa'
AND (
token = 'ke6Ty8P0/xy0lkO2DuR/F75vkTE40mXeVKgYmdAo9DU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)