UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D0j+T9O+ix3YGPiEXxb6FtJ3OzEVvnWn6A0rDde6pKA='
WHERE
key_id = 'c5e01aeea740c655ff729f52af152841dc4b5998bbad5141a6ec7602127b7c61'
AND (
token = 'D0j+T9O+ix3YGPiEXxb6FtJ3OzEVvnWn6A0rDde6pKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)