UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S1UEZCh6FGICdRljB2k+rysQ9HEx2Z3VUjPV1Kk6pBs='
WHERE
key_id = '219825c2a57e8f1e61f0a677c83c1a76b59c76e7141b5cf60d8d5d18909bf16f'
AND (
token = 'S1UEZCh6FGICdRljB2k+rysQ9HEx2Z3VUjPV1Kk6pBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)