UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+GRjKMZrteYRzs/Y4iHINYigxBTI+6r3LLVNPaxqJXk=' 
WHERE 
  key_id = '1135302850704e5c4739f5c8ba6d39146ea87bf982f5cfccf7cc2f3a1ceadaa5' 
  AND (
    token = '+GRjKMZrteYRzs/Y4iHINYigxBTI+6r3LLVNPaxqJXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024