UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E7oLIpuiC7UdVQb4AhOxSTRn7KBceTVGMfuM8LAZLBo='
WHERE
key_id = '6f80d831746c54c3f3b751f28775c370af74cfa8f828a5e777919bb2cf6c531d'
AND (
token = 'E7oLIpuiC7UdVQb4AhOxSTRn7KBceTVGMfuM8LAZLBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)