UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3oluos7G92FpaN+2UP9P8Ydgi0F5DJTlsR//0BZ6b5w='
WHERE
key_id = '1bb614c606f53420d835f2122b9123b76e46e8e1ecc184a79590ab8b6a4c1700'
AND (
token = '3oluos7G92FpaN+2UP9P8Ydgi0F5DJTlsR//0BZ6b5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)