UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DaihRlyxhxqh7k2GJNO5aRy8abkgrgXIM3PTpFqZaNQ='
WHERE
key_id = '7728f3337e49bcd6c3ad34be8ea9c35c54277f00d7a2325e755691b50b291d75'
AND (
token = 'DaihRlyxhxqh7k2GJNO5aRy8abkgrgXIM3PTpFqZaNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)