UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yR1+lw+JHsJEccUYbBAUpppXhUdIV72OoaYxOt0I4bY='
WHERE
key_id = 'f9dc9df7a44cd80116f38ccf9f7b981b6de9ba6c473ea9c5299fd94fd269c46a'
AND (
token = 'yR1+lw+JHsJEccUYbBAUpppXhUdIV72OoaYxOt0I4bY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)