UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+1dS1e+LotlJVI3BAM7jgYMmpWvXSdJ12fp7pD48cgc='
WHERE
key_id = '3b1dbe07505f0ed8bd65bfae31fe9167e9ec6a4fedd586336873013c77f9e7c1'
AND (
token = '+1dS1e+LotlJVI3BAM7jgYMmpWvXSdJ12fp7pD48cgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)