UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6XxMN/K/Wf+k2c4ISoMCvhmN6ZLt36657TpQYuoAHOM=' 
WHERE 
  key_id = '71ded07333abe614ef2bdb383c27d247e9e40eab2750c2954256badf176c34cb' 
  AND (
    token = '6XxMN/K/Wf+k2c4ISoMCvhmN6ZLt36657TpQYuoAHOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057