UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OlkghpSI40gmri4TbUkkJkQRZilLBItOetjA9nqi0c0='
WHERE
key_id = '4aadb020d89f53399a27e116211685e5d0da4f73007c9e1bda598812ea3547b0'
AND (
token = 'OlkghpSI40gmri4TbUkkJkQRZilLBItOetjA9nqi0c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)