UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IG0xnjolpGoxqaO55liT8CvDyCHX90FupREPaEUtC1A='
WHERE
key_id = '46d9daadc598e4c6f76fd61dd7216fdd3f9e00b3678fe6d74f7b0b866f4a6546'
AND (
token = 'IG0xnjolpGoxqaO55liT8CvDyCHX90FupREPaEUtC1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)