UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ExdSZkxWA8VPByNgT9r011B5SMxmUGdCdifVBOR4bXo='
WHERE
key_id = '2fd64a267bdbcbb4d71c56d7bcc2ce7a84896a27bc988d517d965db5c397bd67'
AND (
token = 'ExdSZkxWA8VPByNgT9r011B5SMxmUGdCdifVBOR4bXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)