UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ihsuwiUUCnsSBrRMK2aCm5qlLgbMDM7wcAP5O7/LSX8='
WHERE
key_id = 'f8c15fd557e9d1937ae38a495b6ab79ccc8b5252440a45d6c0c031bb489f8db8'
AND (
token = 'ihsuwiUUCnsSBrRMK2aCm5qlLgbMDM7wcAP5O7/LSX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)