UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IP9ZR/9cTdONKaz7L3W47Ton6N5MBjpVCUkp1yJLVcg='
WHERE
key_id = 'f889663da07dba1de3eb7c66ce36fbaeb53dd90bfa900e40181b645b3fad4e7c'
AND (
token = 'IP9ZR/9cTdONKaz7L3W47Ton6N5MBjpVCUkp1yJLVcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)