UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mDTQL10lKd/YDvx/HSCZqCz3LPfXZCZLi+SYXTJ9U5s=' 
WHERE 
  key_id = 'b6162ba304ac812714354c3bcb688e44cdc0c729b284301331013cd63658ebcc' 
  AND (
    token = 'mDTQL10lKd/YDvx/HSCZqCz3LPfXZCZLi+SYXTJ9U5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026