UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bYTSMusFcV/Hb3EwOpFYCVQo/ZpaIN1EPYjPCQG9+1Q=' 
WHERE 
  key_id = 'dd3071b0b9dd4d69ac39da930129c48431917be26beac808b01e8f3db60d1c86' 
  AND (
    token = 'bYTSMusFcV/Hb3EwOpFYCVQo/ZpaIN1EPYjPCQG9+1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028