UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mR1xKXuxno6N2898XTLtx1L5SrFfLBLjm6UeLfd66h0=' 
WHERE 
  key_id = '125f3b9b769c6ea3bf4546bd38e833eb6de60f8c86c56dc8e50437b462979253' 
  AND (
    token = 'mR1xKXuxno6N2898XTLtx1L5SrFfLBLjm6UeLfd66h0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033