UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U2VEbM719eIj/+m9xOXTn5zDcjDFYz4M4kamcNl+Ra8='
WHERE
key_id = 'f423ec69bb836f5f676b80d20c4182247a329a4ae7d2b1ddb782075fc9e8450b'
AND (
token = 'U2VEbM719eIj/+m9xOXTn5zDcjDFYz4M4kamcNl+Ra8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)