UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vA12tDcvVOukzWXcFKYL8BTeRYOg2jdrzbluR3nNbPY='
WHERE
key_id = 'd414fb3060cd998540554fc37634a778534d18a74c5680746fe4655b25e97a2b'
AND (
token = 'vA12tDcvVOukzWXcFKYL8BTeRYOg2jdrzbluR3nNbPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)