UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 're8sQ32OLQE/ov1rWUal6URN43SDfzzQt08duvTLa6A='
WHERE
key_id = 'bca7809f50c2df2eb210df7fa9f7ecfe05c9213753f4b2594ed7b004a18e94ed'
AND (
token = 're8sQ32OLQE/ov1rWUal6URN43SDfzzQt08duvTLa6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)