UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jZ0LTYqbpAkKslInVB30S4+qLAquIIVquuyp1Er0j8A='
WHERE
key_id = 'ecb2c6b94fd4dd75b5f2b0f0bc8ab4b0b2c24d61f6d8b791f58104409b8a8128'
AND (
token = 'jZ0LTYqbpAkKslInVB30S4+qLAquIIVquuyp1Er0j8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)