UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7AfFRJOlznEjOlg8hOUkQk+xEuJ05JVu8TYMw5Bt1SQ=' 
WHERE 
  key_id = '93debd815552d00fbfc67c1682fd11c4fe85f6c8ad29a8f3d75795ef9122d60f' 
  AND (
    token = '7AfFRJOlznEjOlg8hOUkQk+xEuJ05JVu8TYMw5Bt1SQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040