UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWzYt9n3gvQkCmUC4dH7wp35FhDXmamJONqz6zAM9ts='
WHERE
key_id = '1038c25279db4138d03bc7dab7956ca763fb9f71b0e8db2b38110fd16e363481'
AND (
token = 'hWzYt9n3gvQkCmUC4dH7wp35FhDXmamJONqz6zAM9ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)