UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gC/4pmVhq/XSKeF6572kPQO9psq2GfWNPEVukdHAEv0='
WHERE
key_id = '0b146b830cfc92665e2681e0c338661d0ad3f0b2ea4e098e575fdb9056312a2e'
AND (
token = 'gC/4pmVhq/XSKeF6572kPQO9psq2GfWNPEVukdHAEv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)