UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yqcWBSMPJC7+mMALdboq01VU0F8acrQapwG8TKx2qIs='
WHERE
key_id = 'a954a6acfe8d74e34de9b6df06cce1a34bd79d0655a2636bd152bcffa477efb6'
AND (
token = 'yqcWBSMPJC7+mMALdboq01VU0F8acrQapwG8TKx2qIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)