UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnlUM9IHQLg94C+rkDAJGFaikHj6lTm0G7JntAQ9P6o=' 
WHERE 
  key_id = '2bab9deae921ce3f16bb2b6091b836bf365a9cd699864a3654173397b7c2148c' 
  AND (
    token = 'ZnlUM9IHQLg94C+rkDAJGFaikHj6lTm0G7JntAQ9P6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025