UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IhD1pzTVsLdKpVaCMSAzHWSGZd3iX5i6KmkptzYPhnM='
WHERE
key_id = '7914e9ef473d101c2f08dd733a40c48c343dbe5ae4ee4afaf4bc8af300ec759b'
AND (
token = 'IhD1pzTVsLdKpVaCMSAzHWSGZd3iX5i6KmkptzYPhnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)