UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WPQfdHSF6ioU4eeyo2TWS6/GaCyuYSSRJa/lokGSVmE='
WHERE
key_id = 'edd04f5b2a56eb9f9c7f4f1617a551db01ca12d6e4a2dcfc6598d7a20c1a75a8'
AND (
token = 'WPQfdHSF6ioU4eeyo2TWS6/GaCyuYSSRJa/lokGSVmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)