UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPfSbz/EJPJOWf6rrptyqs9Urq2hWaA6Sb63B827Q8Y='
WHERE
key_id = '034cf5e37dc8e4d0680bf5a5904e2705500872bd863c38c582aa20bc740360cc'
AND (
token = 'LPfSbz/EJPJOWf6rrptyqs9Urq2hWaA6Sb63B827Q8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)